#ifndef AMS_CORE_H
#define AMS_CORE_H
#include <string>
#include <fstream>
#include <Windows.h>
#include <iostream>
#include <cstdio>
#include <vector>
#include <cstdio>

using std::system;
using std::printf;
using std::vector;
using std::string;
using std::ifstream;
// 日时间点
class DayTimePoint {
public:
    DayTimePoint(): h(0), m(0), s(0) {}
    DayTimePoint(const int &hour, const int &minute, const int &sec): h(hour), m(minute), s(sec) {}
    bool operator==(const DayTimePoint &rhs) {
        return h == rhs.h && m == rhs.m && s == rhs.s;
    }
    int h, m, s;
};
// 单个任务
class Task {
public:
    Task(): src(""), t(){}
    Task(const DayTimePoint &dtp, const string &s): src(s), t(dtp){}
    bool onTime(const DayTimePoint &dtp);
    int exec();
    const string& getTaskSrc() {return src;}
    string src;
    DayTimePoint t;
};
// 时间处理
class TimeHelper {
public:
    TimeHelper() = default;
    DayTimePoint static getCurrentDayTimePoint();
};

void readTasks(vector<Task> &ts);



inline void errorResult(const string &s) {
    std::cout << "Error: " << s << std::endl;
}
#endif